home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / powerb5.zip / P5UTL002.TIP < prev    next >
Text File  |  1993-06-01  |  3KB  |  106 lines

  1. When you delete a DOS file, nothing is actually removed from
  2. the disk. While this gives you the opportunity to unerase
  3. your files, it also means that anyone with the right
  4. software can examine your confidential, "destroyed" data.
  5. Both The Norton Utilities and PC Tools come with utilities
  6. that can erase files beyond all hope of recovery. But if you
  7. don't have one of these collections, you can accomplish the
  8. same thing with my WIPE program.
  9.  
  10. When you run WIPE, give it the name of your file as a
  11. parameter. Once you've verified that you really want to
  12. delete the file, it's wiped according to U. S. Department of
  13. Defense standard DOD 5220.22M for destroying confidential
  14. data. The file is first overwritten with 0s, then 1s, three
  15. times. It's then overwritten again with a random value. I've
  16. added one step not specified by the DOD: The name of the
  17. file is changed to X prior to deletion. This makes it more
  18. difficult to recover the file with an unerase program. Why?
  19. Because many such programs can't restore more than one
  20. deleted file per directory with a one-character name.
  21.  
  22. Vincent D. O'Connor
  23. Babbitt, Minnesota
  24.  
  25. Editor's Note: Mr. O'Connor's original BASIC program
  26. couldn't wipe files larger than 64K. However, it seemed like
  27. such a good idea that I decided to rewrite it in Turbo
  28. Pascal, taking advantage of Pascal's better file handling. A
  29. listing of the program, which I've called VIPER (because it
  30. vipes the file from your hard disk), appears below. A
  31. pre-compiled, ready-to-run version is included as the file
  32. P5UTL\VIPER.EXE on your PowerBase *.* Volume 5 diskette.
  33.  
  34. To use the program, move it to a directory listed in your
  35. AUTOEXEC.BAT file's PATH command. One warning, though: If
  36. you have a disk cache that has delayed writes, it may
  37. prevent this utility from scrubbing the disk properly. If
  38. you use such a cache, disable it before wiping files.
  39.  
  40. ---- BEGIN LISTING ----
  41. program Viper;
  42. {$I-} {$S-} {$R-}
  43.  
  44. var
  45.   f : file;
  46.   pass : Integer;
  47.   ch : Char;
  48.  
  49. procedure Stop;
  50.   begin
  51.   Writeln('Error wiping file!');
  52.   Halt
  53.   end;
  54.  
  55. procedure ErrorCheck;
  56.   begin
  57.   if IOResult <> 0 then
  58.     Stop
  59.   end;
  60.  
  61. procedure WipeWith (var f : file;
  62.                         c : Char);
  63.   var
  64.     i : LongInt;
  65.     r : Word;
  66.   begin
  67.   Reset(f,1); ErrorCheck;
  68.   for i := 1 to FileSize(f) do
  69.     begin
  70.     BlockWrite(f,c,1,r);
  71.     if r <> 1 then Stop
  72.     end;
  73.   Close(f); ErrorCheck;
  74.   end;
  75.  
  76. begin {Wipe}
  77. if ParamCount <> 1 then
  78.   begin
  79.   Writeln('Usage: VIPER <filename>');
  80.   Exit
  81.   end;
  82. Write('Are you SURE you want to wipe this file (Y/N)? ');
  83. Readln(ch);
  84. if UpCase(ch) <> 'Y' then Halt;
  85. Randomize;
  86. Assign(f,ParamStr(1)); ErrorCheck;
  87. for pass := 1 to 3 do
  88.   begin
  89.   WipeWith(f,#0);
  90.   WipeWith(f,#1)
  91.   end;
  92. WipeWith(f,Chr(Random(256)));
  93. Rename(f,'X'); ErrorCheck;
  94. Erase(f); ErrorCheck;
  95. Writeln('Done!')
  96. end.
  97. ---- END LISTING ----
  98.  
  99.  
  100. Title: Superclean File Wipes
  101. Category: UTL
  102. Issue Date: February, 1992
  103. Editor: Brett Glass
  104. Supplementary Files: P5UTL\VIPER.EXE
  105. Filename: P5UTL002.TIP
  106.